﻿using System;
using UnityEngine;

[Serializable]
public struct ChecksumData : IComparable<ChecksumData>
{
    [SerializeField]
    public string filename;
    [SerializeField]
    public int filesize;
    [SerializeField]
    public string checksum;

    public ChecksumData(string filename, int filesize, string checksum)
    {
        this.filename = filename;
        this.filesize = filesize;
        this.checksum = checksum;
    }

    public bool IsDeleted
    {
        get
        {
            return filesize == -1 && string.IsNullOrEmpty(checksum);
        }
    }

    public int CompareTo(ChecksumData other)
    {
        return string.CompareOrdinal(filename, other.filename);
    }
}

[Serializable]
public struct PackageMetaInfo
{
    public int recentPatchCount;
    public int recentMaxFile, recentMaxSize;
    public int oldMaxFile, oldMaxSize;
}